const nodata = require('../tw-lib-base/no-data/props')
const commonProps = require('../tw-lib-base/chart/common-props')
const axisProps = require('../tw-lib-base/chart/axis-props')
const datazoomProps = require('../tw-lib-base/chart/datazoom-props')
const tooltipProps = require('../tw-lib-base/chart/tooltip-props')

module.exports = {
  ...commonProps,

  ...axisProps,
  ...datazoomProps,
  ...tooltipProps,

  data: {
    type: Array,
    default () {
      return [
        ['姓名', '张思睿', '李福娥', '王飞虎'],
        ['语文', 20, 30, 50],
        ['数学', 30, 40, 30],
        ['英语', 25, 25, 50],
        ['物理', 40, 30, 30]
      ]
    },
    name: '图表数据集',
    filedType: 'api'
  },

  yLabel: {
    type: String,
    default: '%',
    name: '坐标轴单位',
    filedType: 'string'
  },

  barMaxWidth: {
    type: String,
    default: '50%',
    name: '柱子最大宽度',
    filedType: 'string'
  },

  isStack: {
    type: String,
    default: 'stack',
    name: '坐标轴堆叠',
    filedType: 'string'
  },

  // 坐标轴
  xAxisType: {
    type: String,
    default: 'value',
    name: 'X轴类型',
    filedType: 'select',
    options: [
      {
        name: 'value',
        value: 'value'
      },
      {
        name: 'category',
        value: 'category'
      },
      {
        name: 'log',
        value: 'log'
      }
    ],
    // 是否支持多选，支持多选时default要指定为数组
    multiple: false
  },
  yAxisType: {
    type: String,
    default: 'category',
    name: 'Y轴类型',
    filedType: 'select',
    options: [
      {
        name: 'value',
        value: 'value'
      },
      {
        name: 'category',
        value: 'category'
      },
      {
        name: 'log',
        value: 'log'
      }
    ],
    // 是否支持多选，支持多选时default要指定为数组
    multiple: false
  },
  minInterval: {
    type: String,
    default: '0',
    name: 'Y坐标轴最小刻度',
    filedType: 'string'
  },
  yAxisMin: {
    type: String,
    default: '',
    name: 'Y坐标最小值',
    filedType: 'string'
  },
  yAxisMax: {
    type: String,
    default: '',
    name: 'Y坐标最大值',
    filedType: 'string'
  },
  yAxisSplitNumber: {
    type: String,
    default: '',
    name: 'Y坐标分段数',
    filedType: 'string'
  },
  useCustomLegend: {
    type: Boolean,
    default: false,
    name: '自定义legend',
    filedType: 'switch'
  },
  dataunit: {
    type: Array,
    default () {
      return ['单位', '件', '件', '件', '项', '次']

    },
    name: '内图表数据集',
    filedType: 'api'
  },

  ...nodata
}
